﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;
using NHibernate.Validator.Constraints;


namespace Domain.Model.Mapping.Conventions
{
    public class NotNullColumnConvention : IPropertyConvention
    {
        public void Apply(IPropertyInstance instance)
        {
            if (instance.Property.MemberInfo.IsDefined(typeof(NotNullAttribute), false))
                instance.Not.Nullable();
        }
    }
}